function Principal(pcanvas) {
	this.canvas = pcanvas;
	this.contexto = pcanvas.getContext("2d");
	this.ancho = pcanvas.width;
	this.alto = pcanvas.height;
	//
	this.pantalla = getPantalla(0);
	//
	/* this.sprite = new Sprite("imagenes/mapa5.png", 
							new DatosSpriteMov(123, 64, 121, 6),
							new DatosSpriteMov(0, 64, 121, 6),
							new DatosSpriteMov(383, 64, 133, 3),
							new DatosSpriteMov(246, 64, 133, 3),
							4, 4, this.pantalla);
	*/
	
	this.sprite = new Sprite("imagenes/mapa5_reducida.png", 
							new DatosSpriteMov(74, 38, 73, 6),
							new DatosSpriteMov(0, 38, 73, 6),
							new DatosSpriteMov(230, 39, 80, 3),
							new DatosSpriteMov(148, 39, 80, 3),
							4, 4, this.pantalla);
	
		
	this.actualizarJuego = function() {
		this.sprite.actualizarEstado();
		this.drawFrame();
	}
	
	this.drawFrame = function(){
		this.contexto.clearRect(0,0,this.ancho,this.alto);
		this.sprite.drawImage(this.contexto);
	}
}

window.onload = function() {
	var principal = new Principal(document.getElementById("canvasMov"));
	setInterval(function(){principal.actualizarJuego()}, 33);
}

